package com.client.rule.decision;

import java.util.HashMap;
import java.util.Map;

import com.client.rule.triple.TripleParser;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RichTextArea;
import com.google.gwt.user.client.ui.VerticalPanel;

public class MessageEditorDialogBox extends DecisionEditorDialogBox{

	
	private RichTextArea area = new RichTextArea();
	
	public MessageEditorDialogBox() {
		super();
		setText("Edition de Message");
		//setWidth("350px");
		//setHeight("300px");		

		VerticalPanel mainPanel = new VerticalPanel();	
		mainPanel.setWidth("400px");
		mainPanel.setHeight("300px");		
		
		HorizontalPanel nomPanel = new HorizontalPanel();
		nomPanel.add(new Label("Nom :"));
		nomPanel.add(nomTextBox);
		mainPanel.add(nomPanel);
		
		VerticalPanel messagePanel = new VerticalPanel();
		messagePanel.add(new Label("Message :"));
	    area.ensureDebugId("cwRichText-area");
	    area.setSize("70%", "14em");
	    messagePanel.add(area);
	    
	    mainPanel.add(messagePanel); 
	   
	    mainPanel.add(panelButton);
	    setWidget(mainPanel);	   
	}
	
	
	@Override
	public Map<String, String> getDecisionData() throws IllegalArgumentException{
		
		Map<String, String> result = new HashMap<String, String>();
		result.put("message", TripleParser.changeForbiddenChar(area.getHTML()));
		return result;
	}

}
